Regress to find Cobb-Douglas parameters

$$ \text{Cobb-Douglas: } Q = A K^{\alpha} L^{\beta} $$$$ \ln(Q) = \ln(A K^\alpha L^\beta) $$$$ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \ln(A) + \alpha \ln(K) + \beta \ln(L) $$$$ \text{CD parameters: } \theta = [A, \alpha, \beta] $$$$ \text{Linear regression: } y = X \theta $$$$ \theta = (X^T X)^{-1} X^T y $$

Formulate Cobb-Douglas with regressed parameters

$$ \ln(f(K,L)) = \ln(0.576) + 0.238 \ln(K) + 0.762 \ln(L) $$$$ f(K,L) = 1.779 K^{0.238} L^{0.762} $$

Plot Cobb-Douglas


Define budget constraint

$$ \text{Budget constraint: } B = rK + wL $$$$ 5000 = 1.5K + 1.92L $$

Define objective function for constrained optimization using Lagrangian

$$ \mathcal{L} = A K^\alpha L^\beta + \lambda(B - rK - wL) $$$$ \mathcal{L} = 1.779 K^{0.238} L^{0.762} + \lambda(5000 - 1.5K - 1.92L) $$
Solve using Newton's Method:
Optimal quantities:
First 3 leading principal minors:
Gradient:
Plot solution:

True solution

Solve for variables the easy way: